/*
 * ChatView.java
 */
package chat;

import chat.server.model.User;
import javax.swing.DefaultListModel;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;

public class ChatMain extends FrameView {

    private DefaultListModel friends;
    private String myNick = "";
    private String myUid = "";
    public ServerClient mServerClient;
    public ClientServer mClientServer;
    public ClientClient mClientClient;
    private User requestFriendUser;
    private User addUser;

    public ChatMain(SingleFrameApplication app) {
        super(app);

        initComponents();
        friendsPanel.setVisible(false);
        lbl_addFriendHint.setVisible(false);
        btnAddRequest.setVisible(false);

        mClientServer = new ClientServer(this);
        mClientServer.start();
        mServerClient = new ServerClient(this);
        mServerClient.start();
    }

    public void setAddUser(User user) {
        addUser = user;
    }

    public String getLoginedUid() {
        return myUid;
    }

    public void setNick(String nick) {
        lbl_nick.setText(nick);
        myNick = nick;
    }

    public void friendRequest(User user) {
        lbl_addFriendHint.setText("用户: " + user.nick + " 请求添加你为好友。");
        lbl_addFriendHint.setVisible(true);
        btnAddRequest.setVisible(true);
        requestFriendUser = user;
    }

    public void userMsg(String uid, boolean show) {
        for (int i = 0; i < friends.size(); i++) {
            User u = (User) friends.getElementAt(i);
            if (u.uid.equals(uid)) {
                u.msg = show;
                friends.setElementAt(u, i);
                break;
            }
        }
    }

    public void userOnline(String uid) {
        for (int i = 0; i < friends.size(); i++) {
            User u = (User) friends.getElementAt(i);
            if (u.uid.equals(uid)) {
                u.online = true;
                friends.setElementAt(u, i);
                break;
            }
        }
    }

    public void userOffline(String uid) {
        for (int i = 0; i < friends.size(); i++) {
            User u = (User) friends.getElementAt(i);
            if (u.uid.equals(uid)) {
                u.online = false;
                friends.setElementAt(u, i);
                break;
            }
        }
    }

    public void getAllUserNotFriended(String strUsers) {
        dlgFindUser.setUsers(strUsers);
    }

    public void logined(boolean success, String nick, String strFriends) {
        if (success) {
            System.out.println("登录成功");
            loginPanel.setVisible(false);
            friendsPanel.setVisible(true);
            lblNewMsg.setVisible(false);
            myNick = nick;
            lbl_nick.setText(nick);

//            friends = new Vector<User>();
            friends = new DefaultListModel();
            if (strFriends.trim().length() > 0) {
                String[] nicks = strFriends.split("\t");
                for (int i = 0; i < nicks.length; i++) {
                    String[] splits = nicks[i].split("#");
                    User user = new User(splits[1], splits[0], "");
                    user.online = Boolean.valueOf(splits[2]);
                    friends.addElement(user);
                }
            }

            lst_friends.setCellRenderer(new ListItemUser());
            lst_friends.setModel(friends);
            friends.addListDataListener(new ListDataListener() {

                public void intervalAdded(ListDataEvent e) {
                    System.out.println("contentsadd on:");
                }

                public void intervalRemoved(ListDataEvent e) {
                    System.out.println("contentsRevmoe on:");
                }

                public void contentsChanged(ListDataEvent e) {
                    User o = (User) ((DefaultListModel) e.getSource()).getElementAt(e.getIndex0());
                    System.out.println("contentsChanged on: " + o.toString());
                }
            });
        }
    }

    private void login(String username, String password) {
        myUid = username;
        mServerClient.login(username, password);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainPanel = new javax.swing.JPanel();
        loginPanel = new javax.swing.JPanel();
        jLogin = new javax.swing.JButton();
        jCancel = new javax.swing.JButton();
        btnRegister = new javax.swing.JButton();
        jUsername = new javax.swing.JTextField();
        jPassword = new javax.swing.JPasswordField();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        friendsPanel = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        lst_friends = new javax.swing.JList();
        lbl_nick = new javax.swing.JLabel();
        lbl_avatar = new javax.swing.JLabel();
        lblNewMsg = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        btnAddFriend = new javax.swing.JButton();
        btnAddRequest = new javax.swing.JButton();
        lbl_addFriendHint = new javax.swing.JLabel();
        btnChangeProfile = new javax.swing.JButton();
        lbl_status = new javax.swing.JLabel();

        mainPanel.setName("mainPanel"); // NOI18N
        mainPanel.setPreferredSize(new java.awt.Dimension(300, 500));
        mainPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        loginPanel.setMinimumSize(new java.awt.Dimension(300, 500));
        loginPanel.setName("loginPanel"); // NOI18N
        loginPanel.setPreferredSize(new java.awt.Dimension(300, 500));

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(chat.ChatApp.class).getContext().getResourceMap(ChatMain.class);
        jLogin.setText(resourceMap.getString("jLogin.text")); // NOI18N
        jLogin.setName("jLogin"); // NOI18N
        jLogin.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLoginMouseClicked(evt);
            }
        });

        jCancel.setText(resourceMap.getString("jCancel.text")); // NOI18N
        jCancel.setName("jCancel"); // NOI18N
        jCancel.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jCancelMouseClicked(evt);
            }
        });

        btnRegister.setText(resourceMap.getString("btnRegister.text")); // NOI18N
        btnRegister.setName("btnRegister"); // NOI18N
        btnRegister.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnRegisterMouseClicked(evt);
            }
        });

        jUsername.setText(resourceMap.getString("jUsername.text")); // NOI18N
        jUsername.setName("jUsername"); // NOI18N

        jPassword.setText(resourceMap.getString("jPassword.text")); // NOI18N
        jPassword.setName("jPassword"); // NOI18N

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        javax.swing.GroupLayout loginPanelLayout = new javax.swing.GroupLayout(loginPanel);
        loginPanel.setLayout(loginPanelLayout);
        loginPanelLayout.setHorizontalGroup(
            loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(loginPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLogin)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jCancel)
                .addGap(78, 78, 78)
                .addComponent(btnRegister, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(loginPanelLayout.createSequentialGroup()
                    .addGap(4, 4, 4)
                    .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel2)
                        .addComponent(jLabel3))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 16, Short.MAX_VALUE)
                    .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jUsername, javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, loginPanelLayout.createSequentialGroup()
                            .addComponent(jPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 239, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(1, 1, 1)))
                    .addGap(5, 5, 5)))
        );
        loginPanelLayout.setVerticalGroup(
            loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(loginPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLogin)
                    .addComponent(jCancel)
                    .addComponent(btnRegister))
                .addContainerGap(463, Short.MAX_VALUE))
            .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(loginPanelLayout.createSequentialGroup()
                    .addGap(213, 213, 213)
                    .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jUsername, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel2))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel3))
                    .addContainerGap(214, Short.MAX_VALUE)))
        );

        mainPanel.add(loginPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));

        friendsPanel.setName("friendsPanel"); // NOI18N
        friendsPanel.setPreferredSize(new java.awt.Dimension(300, 600));

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        lst_friends.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        lst_friends.setName("lst_friends"); // NOI18N
        lst_friends.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lst_friendsMouseClicked(evt);
            }
        });
        lst_friends.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                lst_friendsValueChanged(evt);
            }
        });
        jScrollPane1.setViewportView(lst_friends);

        lbl_nick.setText(resourceMap.getString("lbl_nick.text")); // NOI18N
        lbl_nick.setName("lbl_nick"); // NOI18N

        lbl_avatar.setText(resourceMap.getString("lbl_avatar.text")); // NOI18N
        lbl_avatar.setName("lbl_avatar"); // NOI18N

        lblNewMsg.setText(resourceMap.getString("lblNewMsg.text")); // NOI18N
        lblNewMsg.setName("lblNewMsg"); // NOI18N

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        btnAddFriend.setText(resourceMap.getString("btnAddFriend.text")); // NOI18N
        btnAddFriend.setName("btnAddFriend"); // NOI18N
        btnAddFriend.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnAddFriendMouseClicked(evt);
            }
        });

        btnAddRequest.setText(resourceMap.getString("btnAddRequest.text")); // NOI18N
        btnAddRequest.setName("btnAddRequest"); // NOI18N
        btnAddRequest.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnAddRequestMouseClicked(evt);
            }
        });

        lbl_addFriendHint.setText(resourceMap.getString("lbl_addFriendHint.text")); // NOI18N
        lbl_addFriendHint.setName("lbl_addFriendHint"); // NOI18N

        btnChangeProfile.setText(resourceMap.getString("btnChangeProfile.text")); // NOI18N
        btnChangeProfile.setName("btnChangeProfile"); // NOI18N
        btnChangeProfile.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnChangeProfileMouseClicked(evt);
            }
        });

        lbl_status.setText(resourceMap.getString("lbl_status.text")); // NOI18N
        lbl_status.setName("lbl_status"); // NOI18N

        javax.swing.GroupLayout friendsPanelLayout = new javax.swing.GroupLayout(friendsPanel);
        friendsPanel.setLayout(friendsPanelLayout);
        friendsPanelLayout.setHorizontalGroup(
            friendsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, friendsPanelLayout.createSequentialGroup()
                .addGroup(friendsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, friendsPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 276, Short.MAX_VALUE))
                    .addGroup(friendsPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 125, Short.MAX_VALUE)
                        .addComponent(btnAddFriend))
                    .addGroup(friendsPanelLayout.createSequentialGroup()
                        .addGroup(friendsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(friendsPanelLayout.createSequentialGroup()
                                .addGap(22, 22, 22)
                                .addComponent(lbl_avatar))
                            .addGroup(friendsPanelLayout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(lblNewMsg)
                                .addGap(10, 10, 10)
                                .addComponent(lbl_nick)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 87, Short.MAX_VALUE)
                        .addComponent(btnChangeProfile))
                    .addGroup(friendsPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(lbl_addFriendHint)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 99, Short.MAX_VALUE)
                        .addComponent(btnAddRequest)))
                .addContainerGap())
            .addGroup(friendsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(friendsPanelLayout.createSequentialGroup()
                    .addGap(150, 150, 150)
                    .addComponent(lbl_status, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGap(150, 150, 150)))
        );
        friendsPanelLayout.setVerticalGroup(
            friendsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(friendsPanelLayout.createSequentialGroup()
                .addGroup(friendsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(friendsPanelLayout.createSequentialGroup()
                        .addGap(22, 22, 22)
                        .addGroup(friendsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(friendsPanelLayout.createSequentialGroup()
                                .addGroup(friendsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lbl_avatar)
                                    .addGroup(friendsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(lbl_nick)
                                        .addComponent(lblNewMsg)))
                                .addGap(18, 18, 18)
                                .addComponent(jLabel1))
                            .addComponent(btnAddFriend))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 381, Short.MAX_VALUE))
                    .addGroup(friendsPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(btnChangeProfile)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(friendsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnAddRequest)
                    .addComponent(lbl_addFriendHint))
                .addContainerGap())
            .addGroup(friendsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(friendsPanelLayout.createSequentialGroup()
                    .addGap(250, 250, 250)
                    .addComponent(lbl_status)
                    .addContainerGap(250, Short.MAX_VALUE)))
        );

        mainPanel.add(friendsPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, -1, 500));

        setComponent(mainPanel);
    }// </editor-fold>//GEN-END:initComponents

    private void jLoginMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLoginMouseClicked
        // TODO add your handling code here:
        String username = jUsername.getText();
        String password = jPassword.getText();

        login(username, password);
    }//GEN-LAST:event_jLoginMouseClicked

    private void jCancelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jCancelMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jCancelMouseClicked

    private void lst_friendsValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_lst_friendsValueChanged
        // TODO add your handling code here:
    }//GEN-LAST:event_lst_friendsValueChanged

    private void echo(String str) {
        System.out.println("chatview echo: " + str);
    }

    public void connectUsered(String uip) {
        echo("uip: " + uip);
        String[] ipsplits = uip.split("#");

        String address = ipsplits[0];
        int port = Integer.valueOf(ipsplits[1]);
        mClientClient = new ClientClient(address, port, dlg_Chat);
        mClientClient.start();
        dlg_Chat.setClientClient(mClientClient);
    }

    public void registered(boolean success) {
        if (success) {
            JOptionPane.showMessageDialog(ChatApp.getApplication().getMainFrame(), "注册成功！");
            dlgRegister.dispose();
        }
    }

    public void addFrineded(boolean success) {
        if (success) {
            JOptionPane.showMessageDialog(ChatApp.getApplication().getMainFrame(), "添加好友成功，等待对方确认！");
            dlgFindUser.dispose();
            friends.addElement(addUser);
        }
    }

    public void addFriendComPlete(boolean success) {
        if (success) {
            JOptionPane.showMessageDialog(ChatApp.getApplication().getMainFrame(), "添加好友成功！");
            lbl_addFriendHint.setVisible(false);
            btnAddRequest.setVisible(false);
            friends.addElement(requestFriendUser);
        }
    }

    private void lst_friendsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lst_friendsMouseClicked
        // TODO add your handling code here:
        JList theList = (JList) evt.getSource();
        if (evt.getClickCount() == 2) {
            int index = theList.locationToIndex(evt.getPoint());
            if (index >= 0) {
                User o = (User) theList.getModel().getElementAt(index);
                System.out.println("Double-clicked on: " + o.toString());

                if (dlg_Chat == null) {
                    JFrame mainFrame = ChatApp.getApplication().getMainFrame();
                    dlg_Chat = new ChatBox(mainFrame, myUid, mServerClient, mClientClient, mClientServer);
                    dlg_Chat.setLocationRelativeTo(mainFrame);
                }
                dlg_Chat.setOtherNick(o.toString());
                dlg_Chat.setMyNick(myNick);
                mClientServer.setChatBox(dlg_Chat);
                mServerClient.connectUser(o.uid);
                userMsg(o.uid, false);
                dlg_Chat.setMsg(mClientServer.getSavedStrings());
//                ChatApp.getApplication().show(dlg_Chat);
                dlg_Chat.setVisible(true);

            }
        }
    }//GEN-LAST:event_lst_friendsMouseClicked

    private void btnRegisterMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnRegisterMouseClicked
        // TODO add your handling code here:
        JFrame mainFrame = ChatApp.getApplication().getMainFrame();
        dlgRegister = new Register(mainFrame, true, this);
        dlgRegister.setLocationRelativeTo(mainFrame);
        dlgRegister.setVisible(true);
//        ChatApp.getApplication().showsssssssssss(dlgRegister);
    }//GEN-LAST:event_btnRegisterMouseClicked

    private void btnAddFriendMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnAddFriendMouseClicked
        JFrame mainFrame = ChatApp.getApplication().getMainFrame();
        dlgFindUser = new FindUser(mainFrame, true, this, "");
        dlgFindUser.setLocationRelativeTo(mainFrame);
        dlgFindUser.setVisible(true);
//        ChatApp.getApplication().show(dlgFindUser);
    }//GEN-LAST:event_btnAddFriendMouseClicked

    private void btnAddRequestMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnAddRequestMouseClicked
        String uid2 = requestFriendUser.uid;
        mServerClient.addFriendComplete(myUid, uid2);
    }//GEN-LAST:event_btnAddRequestMouseClicked

    private void btnChangeProfileMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnChangeProfileMouseClicked
        JFrame mainFrame = ChatApp.getApplication().getMainFrame();
        dlgProfile = new Profile(mainFrame, true, myUid, myNick, this);
        dlgProfile.setLocationRelativeTo(mainFrame);
        dlgProfile.setVisible(true);
//        ChatApp.getApplication().show(dlgProfile);
    }//GEN-LAST:event_btnChangeProfileMouseClicked
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAddFriend;
    private javax.swing.JButton btnAddRequest;
    private javax.swing.JButton btnChangeProfile;
    private javax.swing.JButton btnRegister;
    private javax.swing.JPanel friendsPanel;
    private javax.swing.JButton jCancel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JButton jLogin;
    private javax.swing.JPasswordField jPassword;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextField jUsername;
    private javax.swing.JLabel lblNewMsg;
    private javax.swing.JLabel lbl_addFriendHint;
    private javax.swing.JLabel lbl_avatar;
    private javax.swing.JLabel lbl_nick;
    private javax.swing.JLabel lbl_status;
    private javax.swing.JPanel loginPanel;
    private javax.swing.JList lst_friends;
    private javax.swing.JPanel mainPanel;
    // End of variables declaration//GEN-END:variables
    private ChatBox dlg_Chat;
    private Register dlgRegister;
    private FindUser dlgFindUser;
    private Profile dlgProfile;
}
